/**
 * 运营商
 */
import makeApi from './index';
import { request, config } from '../configs';

export const defaultData = {
	query: {
		searchCount: true,
		openSort: true,
		isAsc: false,
		orderByField: 'utime',
		size: 1000
	}
};

export const api = {
	querybase: '/operator/list',
	create: '/operator/add',
	update: '/operator/update',
	remove: '/operator/delete',
	detail: '/operator/detail',
	bindingAccountList: '/operator/bindingAccount',
	switchStatus: '/operator/switch',
	subList: '/operator/listByOperator',
	getSonOperators: '/benefit/shareBenefitRule/sonOperators',
	operatorBindAccount: '/operator/bind',
	editNoticeWay: '/operator/editNoticeWay'
};

function operatorBindingAccountList(data) {
	return request({
		data,
		url: config.api.operatorBindingAccountList,
		method: 'get',
	});
}

const services = makeApi(api);

const {
	querybase,
	create,
	update,
	remove,
	detail,
	bindingAccountList,
	switchStatus,
	subList,
	getSonOperators,
	operatorBindAccount,
	editNoticeWay
} = services;

export {
	querybase,
	create,
	update,
	remove,
	detail,
	bindingAccountList,
	switchStatus,
	subList,
	getSonOperators,
	operatorBindAccount,
	operatorBindingAccountList,
	editNoticeWay
};
export default services;
